Skip to content

Conversation

iabdalkader
Copy link

@iabdalkader iabdalkader commented Sep 17, 2025

Requires:

Example:

#include <SPI.h>

SPISettings mySettings(1000000, MSBFIRST, SPI_MODE0, SPI_PERIPHERAL);

void setup() {
  Serial.begin(115200);
  while (!Serial);
  SPI.begin();
}

void loop() {
  uint8_t buf[] = {0x01, 0x02, 0x03, 0x04};

  SPI.beginTransaction(mySettings);
  SPI.transfer(buf, sizeof(buf));
  SPI.endTransaction();
  
  Serial.println("Received:");
  for (int i=0; i<sizeof(buf); i++) {
    Serial.print("0x"); Serial.println(buf[0], HEX);
  }
  
  delay(100);
}

@iabdalkader iabdalkader force-pushed the spi_controller_mode branch 3 times, most recently from 80c2002 to 1e6e8bd Compare September 18, 2025 10:34
@iabdalkader iabdalkader changed the title libraries/SPI: Add support for controller mode. libraries/SPI: Add support for peripheral mode. Sep 18, 2025
@iabdalkader iabdalkader requested a review from pennam September 19, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant